#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int findMaxConsecutiveOnes(int* nums, int numsSize)
{
    int i = 0;
    int flag = 0;
    int count = 0;
    for (i = 0; i < numsSize; i++)
    {
        if (nums[i] == 1)
        {
            count++;
        }
        else
        {
            if (flag < count)
            {
                flag = count;
            }
            count = 0;
        }
    }
    if (nums[i - 1] == 1)
    {
        return flag>count?flag:count;
    }
    else
    {
        return flag;
    }
}
int main()
{
	int nums[] = { 1,1,0,1,1,1 };
	int numsSize = sizeof(nums) / sizeof(nums[0]);
    int ret = findMaxConsecutiveOnes(nums, numsSize);
    printf("%d",ret);
}